package com.niit.entity;

import java.util.Date;

public class Books {
//    对对象封装：
//    1.把所有属性添加private
//    int --> Integer
    private Integer bookId;
    private String title;
    private String author;
    private String publisher;
    private Date publishTime;
    private Date createTime;
//    2.添加构造函数
    public Books(){}

    public Books(Integer bookId, String title, String author, String publisher, Date publishTime, Date createTime) {
        this.bookId = bookId;
        this.title = title;
        this.author = author;
        this.publisher = publisher;
        this.publishTime = publishTime;
        this.createTime = createTime;
    }
    //    3.给所有属性添加getter和setter

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

//    4.添加toString()

    @Override
    public String toString() {
        return "Books{" +
                "bookId=" + bookId +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", publisher='" + publisher + '\'' +
                ", publishTime=" + publishTime +
                ", createTime=" + createTime +
                '}';
    }
}
